-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getDirectoryContents' which ignores "." and ".." #36
Conversation
Perhaps instead of using a prime (which may be confused for other things), we could call it
I don't see any reason not to :P Thanks for the pull request! |
Thank you for your reply. I will amend the pull request to change the name to I also edited For the sake of simplifing the unit test, should we edit them to use |
I amended the initial commit to change the name to |
While that's fine for the other tests, for |
Thank you for merging it. Sorry I did not answer your complain about the unit test not covering I'll soon do another pull request to fix that (an some other stuff if time is available). |
Don't worry about that – it's all taken care of. Thanks for your contribution! |
Just a heads up in case you happen to be using HEAD: I've renamed |
Remove double quotes around searchPath elements on Windows
getDirectoryContents returns the "." and ".." special directories. However in most cases user do not care about theses values and must manually filter them. This pull request introduces the getDirectoryContents' variant which handle this filtering. I find this really convenient when working with directory listing. Other languages uses the same trick (such as python, with os.listdir(),
Discussion: should we update removeContentsRecursive to use getDirectoryContents' instead of the explicit manual filtering of "." and ".." ?